package com.company.woye.readycommit.adapter;

import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.company.woye.R;
import com.company.woye.onpackage.entity.BoxInfpEntity;

import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

public class ReadyCommitTopAdapter extends BaseAdapter {

    private LayoutInflater inflater;
    private List<BoxInfpEntity> listSonEntities;

    public ReadyCommitTopAdapter(Context context, List<BoxInfpEntity> listEntities) {
        this.inflater = LayoutInflater.from(context);
        this.listSonEntities = listEntities;
    }

    @Override
    public int getCount() {
        return 20;
    }

    @Override
    public Object getItem(int position) {
        return position;
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder viewHodler ;
        if (convertView == null) {
            convertView = inflater.inflate(R.layout.intem_ready_commit_top_detail, parent, false);
            viewHodler = new ViewHolder(convertView);
            convertView.setTag(viewHodler);
        } else {
            viewHodler = (ViewHolder) convertView.getTag();
        }
        return convertView;
    }



    class ViewHolder {
        @BindView(R.id.tv_order)
        TextView tvOrder;
        @BindView(R.id.process)
        TextView process;
        @BindView(R.id.tv_material_type)
        TextView tvMaterialType;
        @BindView(R.id.tv_code_type)
        TextView tvCodeType;
        @BindView(R.id.tv_num)
        EditText tvNum;
        @BindView(R.id.ll)
        LinearLayout ll;
        @BindView(R.id.tv_part)
        TextView tvPart;
        @BindView(R.id.tv_start_code)
        TextView tvStartCode;
        @BindView(R.id.tv_product_ype)
        TextView tvProductYpe;
        @BindView(R.id.tv_memo)
        TextView tvMemo;

        ViewHolder(View view) {
            ButterKnife.bind(this, view);
        }
    }
}
